package org.jeecg.modules.inPlantUpload.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.jeecg.modules.inPlantUpload.entity.InPlantUpload;
import org.jeecg.modules.inPlantUpload.mapper.InPlantUploadMapper;
import org.jeecg.modules.inPlantUpload.service.IInPlantUploadService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Description: 厂内运输车辆信息上传表
 * @Author: jeecg-boot
 * @Date:   2024-07-23
 * @Version: V1.0
 */
@Service
public class InPlantUploadServiceImpl extends ServiceImpl<InPlantUploadMapper, InPlantUpload> implements IInPlantUploadService {

    @Override
    public InPlantUpload getByRegistrationCode(String registrationCode) {
        LambdaQueryWrapper<InPlantUpload> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(InPlantUpload::getRegistrationCode, registrationCode);
        wrapper.orderByDesc(InPlantUpload::getCreateTime);
        wrapper.last("limit 1");
        return baseMapper.selectOne(wrapper);
    }
}
